package String;

import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        //1.输入一个字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String str = sc.next();

        //2.统计字符串
        int count1 = 0;
        int count2 = 0;
        int count3 = 0;
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c <= 'Z' && c >= 'A') {
                //统计大写字母
                count1++;
            } else if (c <= 'z' && c >= 'a') {
                //统计小写字母
                count2++;
            } else if (c > '0' && c < '9') {
                //统计数字字符
                count3++;
            }
        }
        System.out.println("大写字母的次数为"+count1+"，小写字母的次数为"+count2+"，数字次数为"+count3);
    }
}
